xenstore: send error earlier in do_mkdir
authorWei Liu <wei.liu2@citrix.com>
Wed, 20 Jul 2016 14:13:41 +0000 (15:13 +0100)
committerWei Liu <wei.liu2@citrix.com>
Wed, 20 Jul 2016 15:09:21 +0000 (16:09 +0100)
commit7d87d31d33ff7c746290886978d172dcab74369d
tree8e9260246b7e22c5f54ec0a9b21099db005a1563
parentdf592188078abc04a64b6bbee991bb5327f67b46
xenstore: send error earlier in do_mkdir

XenServer's coverity instance complains that a few lines below
create_node dereferences NULL if name == NULL. It however fails to
figure out that if node is NULL, errno won't be ENOENT, so do_mkdir
should have bailed before create_node.

That said, it would be good if we don't need to go through the hops.  We
can bail earlier if name is NULL.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/xenstore/xenstored_core.c